<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8" />
	<title>Aloha Editor command formatBlock tests</title>
	<!-- include qunit -->
	<link rel="stylesheet" href="../../vendor/qunit.css" type="text/css"/>

	<script type="text/javascript" src="../../vendor/qunit.js"></script>

	<script src="../../../lib/require.js" ></script>
	<!-- include jquery -->
	<script	src="../../../lib/vendor/jquery-3.7.0.js" ></script>
	<script type="text/javascript" src="../../vendor/jquery.simulate.js"></script>
	<script>
        require.config({
		    baseUrl: "../"
        });
		var Aloha = {
			settings: {
				jQuery: $,
				baseUrl: '../../../lib'
			}
		};
	</script>

	<!-- include aloha -->
	<script src="../../../lib/aloha.js" ></script>

	<script>
		// load command test suite
		require( ['commandtest'] );
	</script>
	<style type="text/css">
		.aloha-editable ol li { list-style-type: decimal; margin: 1.5em; }
		.aloha-editable ol li ol li{ list-style-type: decimal; margin: 2em; }
	</style>
</head>
<body>
	<!-- include the tests -->
	<script>
	var tests = {
			defaultValue: '',
			defaultCommand: 'formatBlock',
			defaultAttributes: [ ],
			tests: [		        
          {  	start: "foo[]bar<p>extra",
              value: "<p>",
              execResult: "<p>foo[]bar</p><p>extra</p>"
          },
          {   exclude: ["webkit", "msie7.0", "msie8.0"],	
              start: "<span>foo</span>{}<span>bar</span><p>extra",
              value: "<p>",
              execResult: "<p><span>foo</span>{}<span>bar</span></p><p>extra</p>"
          },
          {   include: ["webkit"],	
              start: "<span>foo</span>{}<span>bar</span><p>extra",
              value: "<p>",
              execResult: "<p><span>foo[]</span><span>bar</span></p><p>extra</p>"
          },
          {   exclude: ["webkit", "msie"],	
              start: "<span>foo[</span><span>]bar</span><p>extra",
              value: "<p>",
              execResult: "<p><span>foo[</span><span>]bar</span></p><p>extra</p>"
          },
          {   include: ["webkit"],	
              start: "<span>foo[</span><span>]bar</span><p>extra",
              value: "<p>",
              execResult: "<p><span>foo[]</span><span>bar</span></p><p>extra</p>"
          },
          {  	start: "foo[bar]baz<p>extra",
              value: "<p>",
              execResult: "<p>foo[bar]baz</p><p>extra</p>"
          },
          {  	start: "foo[bar]baz<p>extra",
              value: "<p>",
              execResult: "<p>foo[bar]baz</p><p>extra</p>"
          },
          /* FF7 fails to create this test case
          {  	start: "{<p><p><p>foo</p>}",
              value: "<p>",
              execResult: "<p>{ foo}</p>"
          },
          */
          {  	start: "foo[bar<i>baz]qoz</i>quz<p>extra",
              value: "<p>",
              execResult: "<p>foo[bar<i>baz]qoz</i>quz</p><p>extra</p>"
          },
          {   exclude: ["msie7.0", "msie8.0"],	
              start: "<table><tbody><tr><td>foo<td>b[a]r<td>baz</table>",
              value: "<p>",
              execResult: "<table><tbody><tr><td>foo</td><td><p>b[a]r</p></td><td>baz</td></tr></tbody></table>"
          },
          {   exclude: ["webkit"],	
              start: "<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execresult: "<table><tbody><tr><td>foo</td>{<td><p>bar</p></td>}<td>baz</td></tr></tbody></table>"
          },
          {   include: ["webkit"],	
              start: "<table><tbody><tr data-start=1 data-end=2><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execresult: "<table><tbody><tr><td>foo</td><td><p>[bar</p></td><td>}baz</td></tr></tbody></table>"
          },
          {   exclude: ["webkit", "msie7.0", "msie8.0"],	
              start: "<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execResult: "<table><tbody><tr>{<td><p>foo</p></td><td><p>bar</p></td>}<td>baz</td></tr></tbody></table>"
          },
          {   include: ["webkit"],	
              start: "<table><tbody><tr data-start=0 data-end=2><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execResult: "<table><tbody><tr><td><p>[foo</p></td><td><p>bar</p></td><td>}baz</td></tr></tbody></table>"
          },
          {   exclude: ["webkit", "msie"],	
              start: "<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execResult: "<table><tbody>{<tr><td><p>foo</p></td><td><p>bar</p></td><td><p>baz</p></td></tr>}</tbody></table>"
          },
          {   include: ["webkit"],	
              start: "<table><tbody data-start=0 data-end=1><tr><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execResult: "<table><tbody><tr><td><p>[foo</p></td><td><p>bar</p></td><td><p>baz</p></td></tr></tbody></table>}"
          },
          {   exclude: ["webkit", "msie7.0", "msie8.0"],	
              start: "<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execResult: "<table>{<tbody><tr><td><p>foo</p></td><td><p>bar</p></td><td><p>baz</p></td></tr></tbody>}</table>"
          },
          {   include: ["webkit"],	
              start: "<table data-start=0 data-end=1><tbody><tr><td>foo<td>bar<td>baz</table>",
              value: "<p>",
              execResult: "{<table><tbody><tr><td><p>foo</p></td><td><p>bar</p></td><td><p>baz</p></td></tr></tbody></table>}"
          },
          {   exclude: ["msie7.0", "msie8.0"],	
              start: "{<table><tr><td>foo<td>bar<td>baz</table>}",
              value: "<p>",
              execResult: "{<table><tbody><tr><td><p>foo</p></td><td><p>bar</p></td><td><p>baz</p></td></tr></tbody></table>}"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<blockquote>[foobar]</blockquote>",
              value: "<p>",
              execResult: "<blockquote><p>[foobar]</p></blockquote>"
          },
          {  	start: "<h1>[foobar]</h1>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<h2>[foobar]</h2>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<h3>[foobar]</h3>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<h4>[foobar]</h4>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<h5>[foobar]</h5>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<h6>[foobar]</h6>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<dl><dt>[foo]<dd>bar</dl>",
              value: "<p>",
              execResult: "<p>[foo]</p><dl><dd>bar</dd></dl>"
          },
          {  	start: "<dl><dt>foo<dd>[bar]</dl>",
              value: "<p>",
              execResult: "<dl><dt>foo</dt></dl><p>[bar]</p>"
          },
          {  	start: "<dl><dt>[foo<dd>bar]</dl>",
              value: "<p>",
              execResult: "<p>[foo</p><p>bar]</p>"
          },
          {  	start: "<ol><li>[foobar]</ol>",
              value: "<p>",
              execResult: "<ol><li><p>[foobar]</p></li></ol>"
          },
          {  	start: "<ul><li>[foobar]</ul>",
              value: "<p>",
              execResult: "<ul><li><p>[foobar]</p></li></ul>"
          },
          {  	start: "<address>[foobar]</address>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<pre>[foobar]</pre>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<listing>[foobar]</listing>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<xmp>[foobar]</xmp>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          // Test fails as MSIE 7/8 doesn't support HTML5 tags.
          {   exclude: ["msie7.0", "msie8.0"],	
              start: "<article>[foobar]</article>",
              value: "<p>",
              execResult: "<article><p>[foobar]</p></article>"
          },
          {  	start: "<ins>[foobar]</ins>",
              value: "<p>",
              execResult: "<p><ins>[foobar]</ins></p>"
          },
          {  	start: "<del>[foobar]</del>",
              value: "<p>",
              execResult: "<p><del>[foobar]</del></p>"
          },
          // Following test fails in MSIE 7/8 as it doesn't support HTML5 tags.
          {   exclude: ["msie7.0", "msie8.0"],	
            	start: "<quasit>[foobar]</quasit>",
              value: "<p>",
              execResult: "<p><quasit>[foobar]</quasit></p>"
          },
          {   exclude: ["msie7.0", "msie8.0"],	
            	start: "<quasit style=\"display: block\">[foobar]</quasit>",
              value: "<p>",
              execResult: "<p><quasit style=\"display:block\">[foobar]</quasit></p>"
          },
          {   exclude: ["msie7.0", "msie8.0"],	
            	start: "<quasit style=\"display: block\">[foobar]</quasit>",
              value: "<p>",
              execResult: "<p><quasit style=\"display:block\">[foobar]</quasit></p>"
          },

          {  	start: "<blockquote>[foo]</blockquote><p>extra",
              value: "<blockquote>",
              execResult: "<blockquote>[foo]</blockquote><p>extra</p>"
          },
          /*  Fails in both Webkit & Mozilla 
          {   start: "<blockquote><p>[foo]</p>bar</blockquote><p>extra",
              value: "<blockquote>",
              execResult: "<blockquote>[foo]</blockquote><p>extra</p>"
          },
          */
          // Following tests fails because IE 7/8 adds a space after [foo and bar].
          {   exclude: ["msie7.0", "msie8.0"],	
            	start: "[foo]<blockquote>bar</blockquote><p>extra",
              value: "<blockquote>",
              execResult: "[foo]<blockquote>bar</blockquote><p>extra</p>"
          },
          {   exclude: ["msie7.0", "msie8.0"],	
              start: "<p>[foo<p>bar]<p>baz",
              value: "<blockquote>",
              execResult: "<p>[foo</p><p>bar]</p><p>baz</p>"
          },
          // Following test fails in MSIE 7/8 as it doesn't support HTML5 tags.
          {   exclude: ["msie7.0", "msie8.0"],	
            	start: "<section><p>[foo]</section>",
              value: "<blockquote>",
              execResult: "<section><p>[foo]</p></section>"
          },
          {   exclude: ["msie7.0", "msie8.0"],	
            	start: "<section><hgroup><h1>[foo]</h1><h2>bar</h2></hgroup><p>baz</section>",
              value: "<blockquote>",
              execResult: "<section><hgroup><h1>[foo]</h1><h2>bar</h2></hgroup><p>baz</p></section>"
          },
          {   exclude: ["msie7.0", "msie8.0"],	
            	start: "<section>[foo]</section>",
              value: "<article>",
              execResult: "<section>[foo]</section>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<address>",
              execResult: "<address>[foobar]</address>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<article>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<blockquote>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<dd>",
              execResult: "<dl><dd>[foobar]</dd></dl>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<del>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<dl>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<dt>",
              execResult: "<dl><dt>[foobar]</dt></dl>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<h1>",
              execResult: "<h1>[foobar]</h1>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<h2>",
              execResult: "<h2>[foobar]</h2>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<h3>",
              execResult: "<h3>[foobar]</h3>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<h4>",
              execResult: "<h4>[foobar]</h4>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<h5>",
              execResult: "<h5>[foobar]</h5>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<h6>",
              execResult: "<h6>[foobar]</h6>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<ins>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<li>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<ol>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<pre>",
              execResult: "<pre>[foobar]</pre>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<ul>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "<quasit>",
              execResult: "<div>[foobar]</div>"
          },

          {  	start: "<p>[foobar]</p>",
              value: "<address>",
              execResult: "<address>[foobar]</address>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<article>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<aside>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<blockquote>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<body>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<dd>",
              execResult: "<dl><dd>[foobar]</dd></dl>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<del>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<details>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<dir>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<div>",
              execResult: "<div>[foobar]</div>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<dl>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<dt>",
              execResult: "<dl><dt>[foobar]</dt></dl>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<fieldset>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<figcaption>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<figure>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<footer>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<form>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<h1>",
              execResult: "<h1>[foobar]</h1>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<h2>",
              execResult: "<h2>[foobar]</h2>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<h3>",
              execResult: "<h3>[foobar]</h3>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<h4>",
              execResult: "<h4>[foobar]</h4>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<h5>",
              execResult: "<h5>[foobar]</h5>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<h6>",
              execResult: "<h6>[foobar]</h6>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<header>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<head>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<hgroup>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<hr>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<html>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<ins>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<li>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<listing>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<menu>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<nav>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<ol>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<p>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<plaintext>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<pre>",
              execResult: "<pre>[foobar]</pre>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<section>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<ul>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<xmp>",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<p>[foobar]</p>",
              value: "<quasit>",
              execResult: "<p>[foobar]</p>"
          },
          // Following tests fails in IE 7/8
          // as it adds an extra space between
          // [foo and bar]
          {   exclude: ["msie7.0", "msie8.0"],
            	start: "<p>[foo<p>bar]",
              value: "<address>",
              execResult: "<address>[foo<br>bar]</address>"
          },
          {   exclude: ["msie7.0"],
              start: "<p>[foo<p>bar]",
              value: "<dd>",
              execResult: "<dl><dd>[foo</dd><dd>bar]</dd></dl>"
          },
          {
            	start: "<p>[foo<p>bar]",
              value: "<div>",
              execResult: "<div>[foo</div><div>bar]</div>"
          },
          {   exclude: ["msie7.0", "msie8.0"],
            	start: "<p>[foo<p>bar]",
              value: "<dl>",
              execResult: "<p>[foo</p><p>bar]</p>"
          },
          {   exclude: ["msie7.0"],
            	start: "<p>[foo<p>bar]",
              value: "<dt>",
              execResult: "<dl><dt>[foo</dt><dt>bar]</dt></dl>"
          },
          {   exclude: ["msie7.0"],
              start: "<p>[foo<p>bar]",
              value: "<h1>",
              execResult: "<h1>[foo<br>bar]</h1>"
          },
          {   exclude: ["msie7.0"],
              start: "<p>[foo<p>bar]",
              value: "<h2>",
              execResult: "<h2>[foo<br>bar]</h2>"
          },
          {   exclude: ["msie7.0"],
              start: "<p>[foo<p>bar]",
              value: "<h3>",
              execResult: "<h3>[foo<br>bar]</h3>"
          },
          {   exclude: ["msie7.0"],
              start: "<p>[foo<p>bar]",
              value: "<h4>",
              execResult: "<h4>[foo<br>bar]</h4>"
          },
          {   exclude: ["msie7.0"],
             	start: "<p>[foo<p>bar]",
              value: "<h5>",
              execResult: "<h5>[foo<br>bar]</h5>"
          },
          {   exclude: ["msie7.0"],
             	start: "<p>[foo<p>bar]",
              value: "<h6>",
              execResult: "<h6>[foo<br>bar]</h6>"
          },
          {  	start: "<p>[foo<p>bar]",
              value: "<p>",
              execResult: "<p>[foo</p><p>bar]</p>"
          },
          {  	start: "<div>[foobar]</div>",
              value: "p",
              execResult: "<p>[foobar]</p>"
          },
          {  	start: "<ol><li>[foo]<li>bar</ol>",
              value: "<div>",
              execResult: "<ol><li><div>[foo]</div></li><li>bar</li></ol>"
          },
          /* Due to a bug in isExtraneousLineBreak() function,
           * following tests won't work in IE. 
           */
          {   exclude: ["msie"],	
              start: "<h1>[foo]<br>bar</h1>",
              value: "<p>",
              execResult: "<p>[foo]</p><h1>bar</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>foo<br>[bar]</h1>",
              value: "<p>",
              execResult: "<h1>foo</h1><p>[bar]</p>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>[foo<br>bar]</h1>",
              value: "<p>",
              execResult: "<p>[foo<br>bar]</p>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>[foo]<br>bar</h1>",
              value: "<address>",
              execResult: "<address>[foo]</address><h1>bar</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>foo<br>[bar]</h1>",
              value: "<address>",
              execResult: "<h1>foo</h1><address>[bar]</address>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>[foo<br>bar]</h1>",
              value: "<address>",
              execResult: "<address>[foo<br>bar]</address>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>[foo]<br>bar</h1>",
              value: "<pre>",
              execResult: "<pre>[foo]</pre><h1>bar</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>foo<br>[bar]</h1>",
              value: "<pre>",
              execResult: "<h1>foo</h1><pre>[bar]</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>[foo<br>bar]</h1>",
              value: "<pre>",
              execResult: "<pre>[foo<br>bar]</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>[foo]<br>bar</h1>",
              value: "<h2>",
              execResult: "<h2>[foo]</h2><h1>bar</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>foo<br>[bar]</h1>",
              value: "<h2>",
              execResult: "<h1>foo</h1><h2>[bar]</h2>"
          },
          {   exclude: ["msie"],	
            	start: "<h1>[foo<br>bar]</h1>",
              value: "<h2>",
              execResult: "<h2>[foo<br>bar]</h2>"
          },
          {   exclude: ["msie"],	
            	start: "<p>[foo]<br>bar</p>",
              value: "<h1>",
              execResult: "<h1>[foo]</h1><p>bar</p>"
          },
          {   exclude: ["msie"],	
            	start: "<p>foo<br>[bar]</p>",
              value: "<h1>",
              execResult: "<p>foo</p><h1>[bar]</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<p>[foo<br>bar]</p>",
              value: "<h1>",
              execResult: "<h1>[foo<br>bar]</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<p>[foo]<br>bar</p>",
              value: "<address>",
              execResult: "<address>[foo]</address><p>bar</p>"
          },
          {   exclude: ["msie"],	
            	start: "<p>foo<br>[bar]</p>",
              value: "<address>",
              execResult: "<p>foo</p><address>[bar]</address>"
          },
          {   exclude: ["msie"],	
            	start: "<p>[foo<br>bar]</p>",
              value: "<address>",
              execResult: "<address>[foo<br>bar]</address>"
          },
          {   exclude: ["msie"],	
            	start: "<p>[foo]<br>bar</p>",
              value: "<pre>",
              execResult: "<pre>[foo]</pre><p>bar</p>"
          },
          {   exclude: ["msie"],	
            	start: "<p>foo<br>[bar]</p>",
              value: "<pre>",
              execResult: "<p>foo</p><pre>[bar]</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<p>[foo<br>bar]</p>",
              value: "<pre>",
              execResult: "<pre>[foo<br>bar]</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<address>[foo]<br>bar</address>",
              value: "<p>",
              execResult: "<p>[foo]</p><address>bar</address>"
          },
          {   exclude: ["msie"],	
            	start: "<address>foo<br>[bar]</address>",
              value: "<p>",
              execResult: "<address>foo</address><p>[bar]</p>"
          },
          {   exclude: ["msie"],	
            	start: "<address>[foo<br>bar]</address>",
              value: "<p>",
              execResult: "<p>[foo<br>bar]</p>"
          },
          {   exclude: ["msie"],	
            	start: "<address>[foo]<br>bar</address>",
              value: "<pre>",
              execResult: "<pre>[foo]</pre><address>bar</address>"
          },
          {   exclude: ["msie"],	
            	start: "<address>foo<br>[bar]</address>",
              value: "<pre>",
              execResult: "<address>foo</address><pre>[bar]</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<address>[foo<br>bar]</address>",
              value: "<pre>",
              execResult: "<pre>[foo<br>bar]</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<address>[foo]<br>bar</address>",
              value: "<h1>",
              execResult: "<h1>[foo]</h1><address>bar</address>"
          },
          {   exclude: ["msie"],	
            	start: "<address>foo<br>[bar]</address>",
              value: "<h1>",
              execResult: "<address>foo</address><h1>[bar]</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<address>[foo<br>bar]</address>",
              value: "<h1>",
              execResult: "<h1>[foo<br>bar]</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>[foo]<br>bar</pre>",
              value: "<p>",
              execResult: "<p>[foo]</p><pre>bar</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>foo<br>[bar]</pre>",
              value: "<p>",
              execResult: "<pre>foo</pre><p>[bar]</p>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>[foo<br>bar]</pre>",
              value: "<p>",
              execResult: "<p>[foo<br>bar]</p>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>[foo]<br>bar</pre>",
              value: "<address>",
              execResult: "<address>[foo]</address><pre>bar</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>foo<br>[bar]</pre>",
              value: "<address>",
              execResult: "<pre>foo</pre><address>[bar]</address>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>[foo<br>bar]</pre>",
              value: "<address>",
              execResult: "<address>[foo<br>bar]</address>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>[foo]<br>bar</pre>",
              value: "<h1>",
              execResult: "<h1>[foo]</h1><pre>bar</pre>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>foo<br>[bar]</pre>",
              value: "<h1>",
              execResult: "<pre>foo</pre><h1>[bar]</h1>"
          },
          {   exclude: ["msie"],	
            	start: "<pre>[foo<br>bar]</pre>",
              value: "<h1>",
              execResult: "<h1>[foo<br>bar]</h1>"
          },
          {   exclude: ["msie7.0"],	
              start: "[foo<p>bar]</p>",
              value: "<h1>",
              execResult: "<h1>[foo<br>bar]</h1>"
          },
          {  	start: "<div>[foo<p>bar]</p></div>",
              value: "<p>",
              execResult: "<div><p>[foo</p><p>bar]</p></div>"
          },
          {  	start: "<xmp>[foo]</xmp>",
              value: "<p>",
              execResult: "<p>[foo]</p>"
          },
          {  	start: "<xmp>[foo]</xmp>",
              value: "<div>",
              execResult: "<div>[foo]</div>"
          },

          {  	start: "<div><ol><li>[foo]</ol></div>",
              value: "<div>",
              execResult: "<div><ol><li><div>[foo]</div></li></ol></div>"
          },
          {  	start: "<div><table><tr><td>[foo]</table></div>",
              value: "<div>",
              execResult: "<div><table><tbody><tr><td><div>[foo]</div></td></tr></tbody></table></div>"
          },
          {  	start: "<p>[foo<h1>bar]</h1>",
              value: "<div>",
              execResult: "<div>[foo</div><div>bar]</div>"
          },
          {  	start: "<h1>[foo</h1><h2>bar]</h2>",
              value: "<div>",
              execResult: "<div>[foo</div><div>bar]</div>"
          },
          {   exclude: ["msie"],	
              start: "<div>[foo</div>bar]",
              value: "<div>",
              execResult: "<div>[foo</div><div>bar]</div>"
          },
          {  	start: "<div style=color:blue>[foo]</div>",
              value: "<p>",
              execResult: "<p><span color=\"#0000ff\">[foo]</span></p>"
              // as per spec, result should be a font tag but, most browser implementations returns a span.
          },
          {   exclude: ["webkit", "msie7.0", "msie8.0"],	
              start: "{<p>foo</p>ba]r",
              value: "<h1>",
              execResult: "<h1>{foo<br>ba]r</h1>"
          },
          {   include: ["webkit", "msie8.0"],	
              start: "{<p>foo</p>ba]r",
              value: "<h1>",
              execResult: "<h1>[foo<br>ba]r</h1>"
          }
			]
	}
	</script>
	<h1 id="qunit-header">Aloha Editor command format block tests</h1>
	<h2 id="qunit-banner"></h2>
	<div id="qunit-testrunner-toolbar"></div>
	<h2 id="qunit-userAgent"></h2>
	<ol id="qunit-tests"></ol>
	<div id="qunit-fixture"></div>
	<div id="edit" style="margin:20px; border:1px solid #000000;"></div>
	<div id="logBody"></div>
	</div>
</body>
</html>
